package com.xc.hotelmgr.datahandlermt.expection;


import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.ControllerAdvice;
import org.springframework.web.bind.annotation.ExceptionHandler;

@Slf4j
@ControllerAdvice
public class MyExceptionHandler {

    @ExceptionHandler(value =Exception.class)
    public void exceptionHandler(Exception e){
        log.error(e.getMessage());
    }

    /**
     * 处理自定义异常
     */
    @ExceptionHandler(MTReqException.class)
    public void handleRRException(MTReqException e){
       throw e;
    }

}
